<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">

    </div>
    <script>
        function create_user (name, age, sex, money) {
            var person = new Object;
            person.name = name;
            person.age = age;
            person.sex = sex;
            person.money = money;
            // 对象中的方法
            person.intro = function() {
                var str = `name:${person.name}, age: ${person.age}, 
                sex:${person.sex}, money: ${person.money}`;
                var oDiv = document.querySelector('#app');
                oDiv.innerHTML = str;
            };
            return person
        }
        var fei = create_user('大飞哥', 18, '男', 9999);
        var star = create_user('super star', 18, '程序yuan', 99999);
        fei.intro()
        star.intro()
        console.log(star instanceof create_user);
        console.log(fei.constructor);
    </script>
</body>
</html>